<script type="text/html" template>
    <link rel="stylesheet" href="{{ layui.setter.base }}style/login.css?v={{ layui.admin.v }}-1" media="all">
</script>


<div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login">
    <div style="width: 100%;height: 490px;position: absolute;margin: auto;top: 0;left: 0;right: 0;bottom: 0">

<!--        原版  style="background-color: white;border-radius:5px;width: 21%;margin: 13% 0 0 53%"-->
        <div class="layadmin-user-login-main"

             style="background-color: transparent;border-radius:5px;width: 21%;margin: 13% 0 0 59.5%">
            <!--    <div class="layadmin-user-login-main" style="margin-left: 53%;margin-top: 6.5%;background-color: white;width: 300px">-->


            <!--            <div class="layadmin-user-login-box layadmin-user-login-header">-->

            <!--            </div>-->
        <script type="text/html" template="">
            <form class="layui-form" method="post" action="{{layui.setter.loginAddr}}/auth/processlogin">


<!--            第一版-->
<!--            <div class="layadmin-user-login-box layadmin-user-login-body layui-form" style="margin: -8% auto">-->
<!--                第二版-->
            <div class="layadmin-user-login-box layadmin-user-login-body layui-form" style="margin: -8% auto">
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-username" style="font-size: 160%"
                           for="LAY-user-login-username"></label>
                    <input type="text" name="username" id="LAY-user-login-username" lay-verify="required"
                           placeholder="请输入账户"
                           class="layui-input">
                </div>
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-password" style="font-size: 160%"
                           for="LAY-user-login-password"></label>
                    <input type="password" name="password" id="LAY-user-login-password" lay-verify="required"
                           placeholder="请输入密码" class="layui-input">
                </div>
                <!--滑块验证-->
                <div class="layui-form-item">
                    <label class="layui-form-label"></label>
                    <div id="slider"></div>
                </div>

                <div class="layui-form-item" >
<!--                    <input type="checkbox" name="remember" lay-skin="primary" title="记住密码">-->
                    <a lay-href="/user/forget" class="layadmin-user-jump-change layadmin-link"
                       style="display: none"><span style="color: white"> 忘记密码？</span></a>
                </div>
                <div class="layui-form-item" style="color: #2D93CA;margin-top: 0%;margin-bottom: 0">
                    <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="LAY-user-login-submit"
                            style="background-color: #2D93CA"><span style="font-size: 120%">登 录</span>
                    </button>
                </div>
                <div class="layui-trans layui-form-item layadmin-user-login-other" style="display: none">
                    <label>社交账号登入</label>
                    <a href="javascript:;"><i class="layui-icon layui-icon-login-qq"></i></a>
                    <a href="javascript:;"><i class="layui-icon layui-icon-login-wechat"></i></a>
                    <a href="javascript:;"><i class="layui-icon layui-icon-login-weibo"></i></a>

                    <a lay-href="/user/reg" class="layadmin-user-jump-change layadmin-link">注册帐号</a>
                </div>
            </div>
        </form>
        </script>
        </div>
    </div>

    <!--    <div class="layui-trans layadmin-user-login-footer" >-->
    <!--        <p style="color: #999">© 2020 国家税务总局许昌市税务局  技术支持：神州数码信息系统有限公司</p>-->
    <!--    </div>-->


</div>

<script>

    // 正确的情况
    layui.use(['sliderVerify', 'admin', 'form', 'user'], function () {
        var sliderVerify = layui.sliderVerify;
        var slider = sliderVerify.render({
            elem: '#slider',
            onOk: function () {//当验证通过回调
                layer.msg("滑块验证通过");
            }
        })

        var $ = layui.$
            , setter = layui.setter
            , admin = layui.admin
            , form = layui.form
            , router = layui.router()
            , search = router.search;

        form.render();

        //提交
        // form.on('submit(LAY-user-login-submit)', function (obj) {
        //         admin.req({
        //             url: './json/user/login.js' //实际使用请改成服务端真实接口
        //             // url: 'http://127.0.0.1:8000/login/' //实际使用请改成服务端真实接口
        //             // url: 'http://10.0.23.97:8094/auth/processlogin/' //实际使用请改成服务端真实接口
        //             ,type:'post'
        //             , data: obj.field
        //             , done: function (res) {
        //                 if (res.code === 0) {
        //                     //请求成功后，写入 access_token
        //                     layui.data(setter.tableName, {
        //                         key: setter.request.tokenName
        //                         , value: res.access_token
        //                     });
        //
        //                     //登入成功的提示与跳转
        //                     layer.msg('登入成功', {
        //                         offset: '15px'
        //                         , icon: 1
        //                         , time: 1000
        //                     }, function () {
        //                         location.hash = "/home/home";
        //                     });
        //                 } else {
        //                     layer.msg('用户名密码有误', {
        //                         offset: '15px'
        //                         , icon: 1
        //                         , time: 1000
        //                     }, function () {
        //                         // location.hash = "/home/home";
        //                     });
        //                 }
        //
        //             }
        //         });
        //
        // });

    });
</script>